local extension = Package:new("ty_1v2_cards", Package.CardPack)
extension.extensionName = "mamashengde"
extension.game_modes_whitelist = {
  "ty_1v2_mode",
}
extension.game_modes_blacklist = {
  "aaa_role_mode",
  "m_1v1_mode",
  "m_1v2_mode",
  "m_2v2_mode",
  "zombie_mode",
  "heg_mode",
}

extension:loadSkillSkelsByPath("./packages/mamashengde/pkg/ty_1v2_cards/skills")
extension:loadSkillSkelsByPath("./packages/tenyear/pkg/tenyear_token/skills")

Fk:loadTranslationTable{
  ["ty_1v2_cards"] = "兵临城下",
}

extension:addCardSpec("ty__enemy_at_the_gates", Card.Club, 4)
extension:addCardSpec("ty__enemy_at_the_gates", Card.Spade, 10)

extension:addCardSpec("crossing_the_river_in_white", Card.Heart, 6)

extension:addCardSpec("kicking_while_down", Card.Club, 6)

extension:addCardSpec("ty1v2__drowning", Card.Spade, 6)

extension:addCardSpec("catapult", Card.Diamond, 12)

local ty__enemy_at_the_gates = fk.CreateCard{
  name = "ty__enemy_at_the_gates",
  type = Card.TypeTrick,
  sub_type = Card.SubtypeDelayedTrick,
  skill = "ty__enemy_at_the_gates_skill",
}
Fk:loadTranslationTable{
  ["ty__enemy_at_the_gates"] = "兵临城下",
  [":ty__enemy_at_the_gates"] = "延时锦囊牌<br/>"..
  "<b>时机</b>：出牌阶段<br/>"..
  "<b>目标</b>：一名其他角色<br/>"..
  "<b>效果</b>：将【兵临城下】置于目标角色判定区里。若判定结果不为<font color='red'>♦</font>：其选择弃置装备区所有牌或受到1点伤害",

  ["ty__enemy_at_the_gates_skill"] = "兵临城下",
  ["#ty__enemy_at_the_gates_skill"] = "选择一名其他角色，将此牌置于其判定区内。其判定阶段判定：<br/>若结果不为<font color='#CC3131'>♦</font>，"..
  "其选择弃置装备区所有牌或受到1点伤害",
}

local crossing_the_river_in_white = fk.CreateCard{
  name = "crossing_the_river_in_white",
  type = Card.TypeTrick,
  skill = "crossing_the_river_in_white_skill",
}
Fk:loadTranslationTable{
  ["crossing_the_river_in_white"] = "白衣渡江",
  [":crossing_the_river_in_white"] = "锦囊牌<br/>"..
  "<b>时机</b>：出牌阶段<br/>"..
  "<b>目标</b>：城主<br/>"..
  "<b>效果</b>：你选择令目标角色执行一项：1.将手牌摸至全场最多；2.将手牌弃置至全场最少",

  ["crossing_the_river_in_white_skill"] = "白衣渡江",
  ["#crossing_the_river_in_white_skill"] = "对城主使用，你令其将手牌摸至最多，或弃置至最少",
}

local kicking_while_down = fk.CreateCard{
  name = "kicking_while_down",
  type = Card.TypeTrick,
  skill = "kicking_while_down_skill",
  is_damage_card = true,
  multiple_targets = true,
}
Fk:loadTranslationTable{
  ["kicking_while_down"] = "落井下石",
  [":kicking_while_down"] = "锦囊牌<br/>"..
  "<b>时机</b>：出牌阶段<br/>"..
  "<b>目标</b>：所有其他已受伤的角色<br/>"..
  "<b>效果</b>：你对目标角色各造成1点伤害",

  ["kicking_while_down_skill"] = "落井下石",
  ["#kicking_while_down_skill"] = "对所有已受伤的其他角色各造成1点伤害",
}

local ty1v2__drowning = fk.CreateCard{
  name = "ty1v2__drowning",
  type = Card.TypeTrick,
  skill = "ty1v2__drowning_skill",
  is_damage_card = true,
  multiple_targets = true,
}
Fk:loadTranslationTable{
  ["ty1v2__drowning"] = "水淹七军",
  [":ty1v2__drowning"] = "锦囊牌<br/>"..
  "<b>时机</b>：出牌阶段<br/>"..
  "<b>目标</b>：一至两名角色<br/>"..
  "<b>效果</b>：第一名角色受到1点雷电伤害并弃置一张牌，该角色以外的角色受到1点雷电伤害并摸一张牌。",

  ["ty1v2__drowning_skill"] = "水淹七军",
  ["#ty1v2__drowning_skill"] = "选择1-2名目标角色，第一名角色受到1点雷电伤害并弃牌，第二名角色受到1点雷电伤害并摸牌",
}

local catapult = fk.CreateCard{
  name = "catapult",
  type = Card.TypeEquip,
  sub_type = Card.SubtypeWeapon,
  attack_range = 4,
  equip_skill = "#catapult_skill",
}
Fk:loadTranslationTable{
  ["catapult"] = "投石车",
  [":catapult"] = "装备牌·武器<br/>"..
  "<b>攻击范围</b>：4<br/>"..
  "<b>武器技能</b>：回合结束时，你令手牌数大于你的角色各弃置一张手牌。",

  ["#catapult_skill"] = "投石车",
}

extension:loadCardSkels {
  ty__enemy_at_the_gates,
  crossing_the_river_in_white,
  kicking_while_down,
  ty1v2__drowning,

  catapult,
}

return extension